<?php
namespace app\admin\model;
use app\common\model\AdminBase;
class AdminUser extends AdminBase{
    protected $tableName = 'admin';
    protected $fields = [
        0   =>  'id', 
        1   =>  'username', 
        2   =>  'password', 
        3   =>  'salt', 
        4   =>  'login_time',
        5   =>  'login_ip',
        6   =>  'lock',
        7   =>  'login_num',
        8   =>  'rsgtime'
    ];
    /**
     * @name 根据用户ID获取用户名
     */
    public function getUserNameByUid($uid = 0){
        return $this->getFieldById($uid,'username') ?:'';
    }
}